$(function(){
	var requestUrl = String(window.location);
	var hrefUrl;
 	$("#navbar li a").each(function(){
 		hrefUrl = $($(this))[0].href;
        if(hrefUrl.substring(0, hrefUrl.lastIndexOf('/')) == requestUrl.substring(0, requestUrl.lastIndexOf('/')))
            $(this).parent().addClass('active');  
    }); 
 	
	$("#navbar").next().find("a:first").on('click',function(){
		$('.dropdown-toggle').dropdown();
	});
});

//ajax 同步调用
function ajaxRequestTB(requsetUrl, paramData, callback) {
	$.ajax({
		cache : false,
		type : "post",
		url : requsetUrl+"?timestamp="+new Date().getTime(),
		data : paramData,
		async: false,				//同步 
		success : function(back) {
			try {
				callback(back);
			} catch (e) {
				alert("操作发生异常,远程调用失败！");
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			alert("远程调用失败！");
		}
	});
}



